// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate gtype;
extern crate iam_v1;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// A managed metastore service that serves metadata queries.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Service {
    /// Immutable. The relative resource name of the metastore service, in the
    /// following format:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
    pub name: std::string::String,

    /// Output only. The time when the metastore service was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the metastore service was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined labels for the metastore service.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Immutable. The relative resource name of the VPC network on which the
    /// instance can be accessed. It is specified in the following form:
    ///
    /// `projects/{project_number}/global/networks/{network_id}`.
    pub network: std::string::String,

    /// Output only. The URI of the endpoint used to access the metastore service.
    pub endpoint_uri: std::string::String,

    /// The TCP port at which the metastore service is reached. Default: 9083.
    pub port: i32,

    /// Output only. The current state of the metastore service.
    pub state: crate::model::service::State,

    /// Output only. Additional information about the current state of the
    /// metastore service, if available.
    pub state_message: std::string::String,

    /// Output only. A Cloud Storage URI (starting with `gs://`) that specifies
    /// where artifacts related to the metastore service are stored.
    pub artifact_gcs_uri: std::string::String,

    /// The tier of the service.
    pub tier: crate::model::service::Tier,

    /// The one hour maintenance window of the metastore service. This specifies
    /// when the service can be restarted for maintenance purposes in UTC time.
    /// Maintenance window is not needed for services with the SPANNER
    /// database type.
    pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,

    /// Output only. The globally unique resource identifier of the metastore
    /// service.
    pub uid: std::string::String,

    /// Output only. The metadata management activities of the metastore service.
    pub metadata_management_activity: std::option::Option<crate::model::MetadataManagementActivity>,

    /// Immutable. The release channel of the service.
    /// If unspecified, defaults to `STABLE`.
    pub release_channel: crate::model::service::ReleaseChannel,

    /// Immutable. Information used to configure the Dataproc Metastore service to
    /// encrypt customer data at rest. Cannot be updated.
    pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,

    /// The configuration specifying the network settings for the
    /// Dataproc Metastore service.
    pub network_config: std::option::Option<crate::model::NetworkConfig>,

    /// Immutable. The database type that the Metastore service stores its data.
    pub database_type: crate::model::service::DatabaseType,

    /// The configuration specifying telemetry settings for the Dataproc Metastore
    /// service. If unspecified defaults to `JSON`.
    pub telemetry_config: std::option::Option<crate::model::TelemetryConfig>,

    /// Scaling configuration of the metastore service.
    pub scaling_config: std::option::Option<crate::model::ScalingConfig>,

    /// Configuration properties specific to the underlying metastore service
    /// technology (the software that serves metastore queries).
    pub metastore_config: std::option::Option<crate::model::service::MetastoreConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Service {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Service::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Service::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Service::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Service::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Service::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Service::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [network][crate::model::Service::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [endpoint_uri][crate::model::Service::endpoint_uri].
    pub fn set_endpoint_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.endpoint_uri = v.into();
        self
    }

    /// Sets the value of [port][crate::model::Service::port].
    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.port = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Service::state].
    pub fn set_state<T: std::convert::Into<crate::model::service::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [state_message][crate::model::Service::state_message].
    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.state_message = v.into();
        self
    }

    /// Sets the value of [artifact_gcs_uri][crate::model::Service::artifact_gcs_uri].
    pub fn set_artifact_gcs_uri<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.artifact_gcs_uri = v.into();
        self
    }

    /// Sets the value of [tier][crate::model::Service::tier].
    pub fn set_tier<T: std::convert::Into<crate::model::service::Tier>>(mut self, v: T) -> Self {
        self.tier = v.into();
        self
    }

    /// Sets the value of [maintenance_window][crate::model::Service::maintenance_window].
    pub fn set_maintenance_window<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::MaintenanceWindow>,
    {
        self.maintenance_window = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [maintenance_window][crate::model::Service::maintenance_window].
    pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::MaintenanceWindow>,
    {
        self.maintenance_window = v.map(|x| x.into());
        self
    }

    /// Sets the value of [uid][crate::model::Service::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [metadata_management_activity][crate::model::Service::metadata_management_activity].
    pub fn set_metadata_management_activity<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::MetadataManagementActivity>,
    {
        self.metadata_management_activity = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [metadata_management_activity][crate::model::Service::metadata_management_activity].
    pub fn set_or_clear_metadata_management_activity<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::MetadataManagementActivity>,
    {
        self.metadata_management_activity = v.map(|x| x.into());
        self
    }

    /// Sets the value of [release_channel][crate::model::Service::release_channel].
    pub fn set_release_channel<T: std::convert::Into<crate::model::service::ReleaseChannel>>(
        mut self,
        v: T,
    ) -> Self {
        self.release_channel = v.into();
        self
    }

    /// Sets the value of [encryption_config][crate::model::Service::encryption_config].
    pub fn set_encryption_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::EncryptionConfig>,
    {
        self.encryption_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [encryption_config][crate::model::Service::encryption_config].
    pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::EncryptionConfig>,
    {
        self.encryption_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [network_config][crate::model::Service::network_config].
    pub fn set_network_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NetworkConfig>,
    {
        self.network_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [network_config][crate::model::Service::network_config].
    pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::NetworkConfig>,
    {
        self.network_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [database_type][crate::model::Service::database_type].
    pub fn set_database_type<T: std::convert::Into<crate::model::service::DatabaseType>>(
        mut self,
        v: T,
    ) -> Self {
        self.database_type = v.into();
        self
    }

    /// Sets the value of [telemetry_config][crate::model::Service::telemetry_config].
    pub fn set_telemetry_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::TelemetryConfig>,
    {
        self.telemetry_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [telemetry_config][crate::model::Service::telemetry_config].
    pub fn set_or_clear_telemetry_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::TelemetryConfig>,
    {
        self.telemetry_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [scaling_config][crate::model::Service::scaling_config].
    pub fn set_scaling_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ScalingConfig>,
    {
        self.scaling_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [scaling_config][crate::model::Service::scaling_config].
    pub fn set_or_clear_scaling_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ScalingConfig>,
    {
        self.scaling_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [metastore_config][crate::model::Service::metastore_config].
    ///
    /// Note that all the setters affecting `metastore_config` are mutually
    /// exclusive.
    pub fn set_metastore_config<
        T: std::convert::Into<std::option::Option<crate::model::service::MetastoreConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.metastore_config = v.into();
        self
    }

    /// The value of [metastore_config][crate::model::Service::metastore_config]
    /// if it holds a `HiveMetastoreConfig`, `None` if the field is not set or
    /// holds a different branch.
    pub fn hive_metastore_config(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::HiveMetastoreConfig>> {
        #[allow(unreachable_patterns)]
        self.metastore_config.as_ref().and_then(|v| match v {
            crate::model::service::MetastoreConfig::HiveMetastoreConfig(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [metastore_config][crate::model::Service::metastore_config]
    /// to hold a `HiveMetastoreConfig`.
    ///
    /// Note that all the setters affecting `metastore_config` are
    /// mutually exclusive.
    pub fn set_hive_metastore_config<
        T: std::convert::Into<std::boxed::Box<crate::model::HiveMetastoreConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.metastore_config = std::option::Option::Some(
            crate::model::service::MetastoreConfig::HiveMetastoreConfig(v.into()),
        );
        self
    }
}

impl wkt::message::Message for Service {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.Service"
    }
}

/// Defines additional types related to [Service].
pub mod service {
    #[allow(unused_imports)]
    use super::*;

    /// The current state of the metastore service.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The state of the metastore service is unknown.
        Unspecified,
        /// The metastore service is in the process of being created.
        Creating,
        /// The metastore service is running and ready to serve queries.
        Active,
        /// The metastore service is entering suspension. Its query-serving
        /// availability may cease unexpectedly.
        Suspending,
        /// The metastore service is suspended and unable to serve queries.
        Suspended,
        /// The metastore service is being updated. It remains usable but cannot
        /// accept additional update requests or be deleted at this time.
        Updating,
        /// The metastore service is undergoing deletion. It cannot be used.
        Deleting,
        /// The metastore service has encountered an error and cannot be used. The
        /// metastore service should be deleted.
        Error,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Suspending => std::option::Option::Some(3),
                Self::Suspended => std::option::Option::Some(4),
                Self::Updating => std::option::Option::Some(5),
                Self::Deleting => std::option::Option::Some(6),
                Self::Error => std::option::Option::Some(7),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Suspending => std::option::Option::Some("SUSPENDING"),
                Self::Suspended => std::option::Option::Some("SUSPENDED"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Error => std::option::Option::Some("ERROR"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Suspending,
                4 => Self::Suspended,
                5 => Self::Updating,
                6 => Self::Deleting,
                7 => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "SUSPENDING" => Self::Suspending,
                "SUSPENDED" => Self::Suspended,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                "ERROR" => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Suspending => serializer.serialize_i32(3),
                Self::Suspended => serializer.serialize_i32(4),
                Self::Updating => serializer.serialize_i32(5),
                Self::Deleting => serializer.serialize_i32(6),
                Self::Error => serializer.serialize_i32(7),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.metastore.v1.Service.State",
            ))
        }
    }

    /// Available service tiers.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Tier {
        /// The tier is not set.
        Unspecified,
        /// The developer tier provides limited scalability and no fault tolerance.
        /// Good for low-cost proof-of-concept.
        Developer,
        /// The enterprise tier provides multi-zone high availability, and sufficient
        /// scalability for enterprise-level Dataproc Metastore workloads.
        Enterprise,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Tier::value] or
        /// [Tier::name].
        UnknownValue(tier::UnknownValue),
    }

    #[doc(hidden)]
    pub mod tier {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Tier {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Developer => std::option::Option::Some(1),
                Self::Enterprise => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
                Self::Developer => std::option::Option::Some("DEVELOPER"),
                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Tier {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Tier {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Tier {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Developer,
                3 => Self::Enterprise,
                _ => Self::UnknownValue(tier::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Tier {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TIER_UNSPECIFIED" => Self::Unspecified,
                "DEVELOPER" => Self::Developer,
                "ENTERPRISE" => Self::Enterprise,
                _ => Self::UnknownValue(tier::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Tier {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Developer => serializer.serialize_i32(1),
                Self::Enterprise => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Tier {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
                ".google.cloud.metastore.v1.Service.Tier",
            ))
        }
    }

    /// Release channels bundle features of varying levels of stability. Newer
    /// features may be introduced initially into less stable release channels and
    /// can be automatically promoted into more stable release channels.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ReleaseChannel {
        /// Release channel is not specified.
        Unspecified,
        /// The `CANARY` release channel contains the newest features, which may be
        /// unstable and subject to unresolved issues with no known workarounds.
        /// Services using the `CANARY` release channel are not subject to any SLAs.
        Canary,
        /// The `STABLE` release channel contains features that are considered stable
        /// and have been validated for production use.
        Stable,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ReleaseChannel::value] or
        /// [ReleaseChannel::name].
        UnknownValue(release_channel::UnknownValue),
    }

    #[doc(hidden)]
    pub mod release_channel {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ReleaseChannel {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Canary => std::option::Option::Some(1),
                Self::Stable => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("RELEASE_CHANNEL_UNSPECIFIED"),
                Self::Canary => std::option::Option::Some("CANARY"),
                Self::Stable => std::option::Option::Some("STABLE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ReleaseChannel {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ReleaseChannel {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ReleaseChannel {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Canary,
                2 => Self::Stable,
                _ => Self::UnknownValue(release_channel::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ReleaseChannel {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "RELEASE_CHANNEL_UNSPECIFIED" => Self::Unspecified,
                "CANARY" => Self::Canary,
                "STABLE" => Self::Stable,
                _ => Self::UnknownValue(release_channel::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ReleaseChannel {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Canary => serializer.serialize_i32(1),
                Self::Stable => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ReleaseChannel {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReleaseChannel>::new(
                ".google.cloud.metastore.v1.Service.ReleaseChannel",
            ))
        }
    }

    /// The backend database type for the metastore service.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum DatabaseType {
        /// The DATABASE_TYPE is not set.
        Unspecified,
        /// MySQL is used to persist the metastore data.
        Mysql,
        /// Spanner is used to persist the metastore data.
        Spanner,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [DatabaseType::value] or
        /// [DatabaseType::name].
        UnknownValue(database_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod database_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl DatabaseType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Mysql => std::option::Option::Some(1),
                Self::Spanner => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
                Self::Mysql => std::option::Option::Some("MYSQL"),
                Self::Spanner => std::option::Option::Some("SPANNER"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for DatabaseType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for DatabaseType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for DatabaseType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Mysql,
                2 => Self::Spanner,
                _ => Self::UnknownValue(database_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for DatabaseType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
                "MYSQL" => Self::Mysql,
                "SPANNER" => Self::Spanner,
                _ => Self::UnknownValue(database_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for DatabaseType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Mysql => serializer.serialize_i32(1),
                Self::Spanner => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for DatabaseType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
                ".google.cloud.metastore.v1.Service.DatabaseType",
            ))
        }
    }

    /// Configuration properties specific to the underlying metastore service
    /// technology (the software that serves metastore queries).
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum MetastoreConfig {
        /// Configuration information specific to running Hive metastore
        /// software as the metastore service.
        HiveMetastoreConfig(std::boxed::Box<crate::model::HiveMetastoreConfig>),
    }
}

/// Maintenance window. This specifies when Dataproc Metastore
/// may perform system maintenance operation to the service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MaintenanceWindow {
    /// The hour of day (0-23) when the window starts.
    pub hour_of_day: std::option::Option<wkt::Int32Value>,

    /// The day of week, when the window starts.
    pub day_of_week: gtype::model::DayOfWeek,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MaintenanceWindow {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [hour_of_day][crate::model::MaintenanceWindow::hour_of_day].
    pub fn set_hour_of_day<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Int32Value>,
    {
        self.hour_of_day = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hour_of_day][crate::model::MaintenanceWindow::hour_of_day].
    pub fn set_or_clear_hour_of_day<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Int32Value>,
    {
        self.hour_of_day = v.map(|x| x.into());
        self
    }

    /// Sets the value of [day_of_week][crate::model::MaintenanceWindow::day_of_week].
    pub fn set_day_of_week<T: std::convert::Into<gtype::model::DayOfWeek>>(mut self, v: T) -> Self {
        self.day_of_week = v.into();
        self
    }
}

impl wkt::message::Message for MaintenanceWindow {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.MaintenanceWindow"
    }
}

/// Specifies configuration information specific to running Hive metastore
/// software as the metastore service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HiveMetastoreConfig {
    /// Immutable. The Hive metastore schema version.
    pub version: std::string::String,

    /// A mapping of Hive metastore configuration key-value pairs to apply to the
    /// Hive metastore (configured in `hive-site.xml`). The mappings
    /// override system defaults (some keys cannot be overridden). These
    /// overrides are also applied to auxiliary versions and can be further
    /// customized in the auxiliary version's `AuxiliaryVersionConfig`.
    pub config_overrides: std::collections::HashMap<std::string::String, std::string::String>,

    /// Information used to configure the Hive metastore service as a service
    /// principal in a Kerberos realm. To disable Kerberos, use the `UpdateService`
    /// method and specify this field's path
    /// (`hive_metastore_config.kerberos_config`) in the request's `update_mask`
    /// while omitting this field from the request's `service`.
    pub kerberos_config: std::option::Option<crate::model::KerberosConfig>,

    /// The protocol to use for the metastore service endpoint. If unspecified,
    /// defaults to `THRIFT`.
    pub endpoint_protocol: crate::model::hive_metastore_config::EndpointProtocol,

    /// A mapping of Hive metastore version to the auxiliary version
    /// configuration. When specified, a secondary Hive metastore service is
    /// created along with the primary service. All auxiliary versions must be less
    /// than the service's primary version. The key is the auxiliary service name
    /// and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This
    /// means that the first character must be a lowercase letter, and all the
    /// following characters must be hyphens, lowercase letters, or digits, except
    /// the last character, which cannot be a hyphen.
    pub auxiliary_versions:
        std::collections::HashMap<std::string::String, crate::model::AuxiliaryVersionConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl HiveMetastoreConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [version][crate::model::HiveMetastoreConfig::version].
    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.version = v.into();
        self
    }

    /// Sets the value of [config_overrides][crate::model::HiveMetastoreConfig::config_overrides].
    pub fn set_config_overrides<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.config_overrides = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [kerberos_config][crate::model::HiveMetastoreConfig::kerberos_config].
    pub fn set_kerberos_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::KerberosConfig>,
    {
        self.kerberos_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [kerberos_config][crate::model::HiveMetastoreConfig::kerberos_config].
    pub fn set_or_clear_kerberos_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::KerberosConfig>,
    {
        self.kerberos_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [endpoint_protocol][crate::model::HiveMetastoreConfig::endpoint_protocol].
    pub fn set_endpoint_protocol<
        T: std::convert::Into<crate::model::hive_metastore_config::EndpointProtocol>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.endpoint_protocol = v.into();
        self
    }

    /// Sets the value of [auxiliary_versions][crate::model::HiveMetastoreConfig::auxiliary_versions].
    pub fn set_auxiliary_versions<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AuxiliaryVersionConfig>,
    {
        use std::iter::Iterator;
        self.auxiliary_versions = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for HiveMetastoreConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.HiveMetastoreConfig"
    }
}

/// Defines additional types related to [HiveMetastoreConfig].
pub mod hive_metastore_config {
    #[allow(unused_imports)]
    use super::*;

    /// Protocols available for serving the metastore service endpoint.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum EndpointProtocol {
        /// The protocol is not set.
        Unspecified,
        /// Use the legacy Apache Thrift protocol for the metastore service endpoint.
        Thrift,
        /// Use the modernized gRPC protocol for the metastore service endpoint.
        Grpc,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [EndpointProtocol::value] or
        /// [EndpointProtocol::name].
        UnknownValue(endpoint_protocol::UnknownValue),
    }

    #[doc(hidden)]
    pub mod endpoint_protocol {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl EndpointProtocol {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Thrift => std::option::Option::Some(1),
                Self::Grpc => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("ENDPOINT_PROTOCOL_UNSPECIFIED"),
                Self::Thrift => std::option::Option::Some("THRIFT"),
                Self::Grpc => std::option::Option::Some("GRPC"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for EndpointProtocol {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for EndpointProtocol {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for EndpointProtocol {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Thrift,
                2 => Self::Grpc,
                _ => Self::UnknownValue(endpoint_protocol::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for EndpointProtocol {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "ENDPOINT_PROTOCOL_UNSPECIFIED" => Self::Unspecified,
                "THRIFT" => Self::Thrift,
                "GRPC" => Self::Grpc,
                _ => Self::UnknownValue(endpoint_protocol::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for EndpointProtocol {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Thrift => serializer.serialize_i32(1),
                Self::Grpc => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for EndpointProtocol {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EndpointProtocol>::new(
                ".google.cloud.metastore.v1.HiveMetastoreConfig.EndpointProtocol",
            ))
        }
    }
}

/// Configuration information for a Kerberos principal.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KerberosConfig {
    /// A Kerberos keytab file that can be used to authenticate a service principal
    /// with a Kerberos Key Distribution Center (KDC).
    pub keytab: std::option::Option<crate::model::Secret>,

    /// A Kerberos principal that exists in the both the keytab the KDC
    /// to authenticate as. A typical principal is of the form
    /// `primary/instance@REALM`, but there is no exact format.
    pub principal: std::string::String,

    /// A Cloud Storage URI that specifies the path to a
    /// krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`,
    /// although the file does not need to be named krb5.conf explicitly.
    pub krb5_config_gcs_uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl KerberosConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [keytab][crate::model::KerberosConfig::keytab].
    pub fn set_keytab<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Secret>,
    {
        self.keytab = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [keytab][crate::model::KerberosConfig::keytab].
    pub fn set_or_clear_keytab<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Secret>,
    {
        self.keytab = v.map(|x| x.into());
        self
    }

    /// Sets the value of [principal][crate::model::KerberosConfig::principal].
    pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.principal = v.into();
        self
    }

    /// Sets the value of [krb5_config_gcs_uri][crate::model::KerberosConfig::krb5_config_gcs_uri].
    pub fn set_krb5_config_gcs_uri<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.krb5_config_gcs_uri = v.into();
        self
    }
}

impl wkt::message::Message for KerberosConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.KerberosConfig"
    }
}

/// A securely stored value.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Secret {
    pub value: std::option::Option<crate::model::secret::Value>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Secret {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [value][crate::model::Secret::value].
    ///
    /// Note that all the setters affecting `value` are mutually
    /// exclusive.
    pub fn set_value<T: std::convert::Into<std::option::Option<crate::model::secret::Value>>>(
        mut self,
        v: T,
    ) -> Self {
        self.value = v.into();
        self
    }

    /// The value of [value][crate::model::Secret::value]
    /// if it holds a `CloudSecret`, `None` if the field is not set or
    /// holds a different branch.
    pub fn cloud_secret(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::secret::Value::CloudSecret(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::Secret::value]
    /// to hold a `CloudSecret`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_cloud_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.value = std::option::Option::Some(crate::model::secret::Value::CloudSecret(v.into()));
        self
    }
}

impl wkt::message::Message for Secret {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.Secret"
    }
}

/// Defines additional types related to [Secret].
pub mod secret {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Value {
        /// The relative resource name of a Secret Manager secret version, in the
        /// following form:
        ///
        /// `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`.
        CloudSecret(std::string::String),
    }
}

/// Encryption settings for the service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EncryptionConfig {
    /// The fully qualified customer provided Cloud KMS key name to use for
    /// customer data encryption, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`.
    pub kms_key: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EncryptionConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [kms_key][crate::model::EncryptionConfig::kms_key].
    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.kms_key = v.into();
        self
    }
}

impl wkt::message::Message for EncryptionConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.EncryptionConfig"
    }
}

/// Configuration information for the auxiliary service versions.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuxiliaryVersionConfig {
    /// The Hive metastore version of the auxiliary service. It must be less
    /// than the primary Hive metastore service's version.
    pub version: std::string::String,

    /// A mapping of Hive metastore configuration key-value pairs to apply to the
    /// auxiliary Hive metastore (configured in `hive-site.xml`) in addition to
    /// the primary version's overrides. If keys are present in both the auxiliary
    /// version's overrides and the primary version's overrides, the value from
    /// the auxiliary version's overrides takes precedence.
    pub config_overrides: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. The network configuration contains the endpoint URI(s) of the
    /// auxiliary Hive metastore service.
    pub network_config: std::option::Option<crate::model::NetworkConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AuxiliaryVersionConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [version][crate::model::AuxiliaryVersionConfig::version].
    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.version = v.into();
        self
    }

    /// Sets the value of [config_overrides][crate::model::AuxiliaryVersionConfig::config_overrides].
    pub fn set_config_overrides<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.config_overrides = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [network_config][crate::model::AuxiliaryVersionConfig::network_config].
    pub fn set_network_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NetworkConfig>,
    {
        self.network_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [network_config][crate::model::AuxiliaryVersionConfig::network_config].
    pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::NetworkConfig>,
    {
        self.network_config = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for AuxiliaryVersionConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.AuxiliaryVersionConfig"
    }
}

/// Network configuration for the Dataproc Metastore service.
///
/// Next available ID: 4
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkConfig {
    /// Immutable. The consumer-side network configuration for the Dataproc
    /// Metastore instance.
    pub consumers: std::vec::Vec<crate::model::network_config::Consumer>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NetworkConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [consumers][crate::model::NetworkConfig::consumers].
    pub fn set_consumers<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::network_config::Consumer>,
    {
        use std::iter::Iterator;
        self.consumers = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for NetworkConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.NetworkConfig"
    }
}

/// Defines additional types related to [NetworkConfig].
pub mod network_config {
    #[allow(unused_imports)]
    use super::*;

    /// Contains information of the customer's network configurations.
    ///
    /// Next available ID: 5
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Consumer {
        /// Output only. The URI of the endpoint used to access the metastore
        /// service.
        pub endpoint_uri: std::string::String,

        /// Output only. The location of the endpoint URI. Format:
        /// `projects/{project}/locations/{location}`.
        pub endpoint_location: std::string::String,

        pub vpc_resource: std::option::Option<crate::model::network_config::consumer::VpcResource>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Consumer {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [endpoint_uri][crate::model::network_config::Consumer::endpoint_uri].
        pub fn set_endpoint_uri<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.endpoint_uri = v.into();
            self
        }

        /// Sets the value of [endpoint_location][crate::model::network_config::Consumer::endpoint_location].
        pub fn set_endpoint_location<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.endpoint_location = v.into();
            self
        }

        /// Sets the value of [vpc_resource][crate::model::network_config::Consumer::vpc_resource].
        ///
        /// Note that all the setters affecting `vpc_resource` are mutually
        /// exclusive.
        pub fn set_vpc_resource<
            T: std::convert::Into<
                    std::option::Option<crate::model::network_config::consumer::VpcResource>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.vpc_resource = v.into();
            self
        }

        /// The value of [vpc_resource][crate::model::network_config::Consumer::vpc_resource]
        /// if it holds a `Subnetwork`, `None` if the field is not set or
        /// holds a different branch.
        pub fn subnetwork(&self) -> std::option::Option<&std::string::String> {
            #[allow(unreachable_patterns)]
            self.vpc_resource.as_ref().and_then(|v| match v {
                crate::model::network_config::consumer::VpcResource::Subnetwork(v) => {
                    std::option::Option::Some(v)
                }
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [vpc_resource][crate::model::network_config::Consumer::vpc_resource]
        /// to hold a `Subnetwork`.
        ///
        /// Note that all the setters affecting `vpc_resource` are
        /// mutually exclusive.
        pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.vpc_resource = std::option::Option::Some(
                crate::model::network_config::consumer::VpcResource::Subnetwork(v.into()),
            );
            self
        }
    }

    impl wkt::message::Message for Consumer {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.metastore.v1.NetworkConfig.Consumer"
        }
    }

    /// Defines additional types related to [Consumer].
    pub mod consumer {
        #[allow(unused_imports)]
        use super::*;

        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum VpcResource {
            /// Immutable. The subnetwork of the customer project from which an IP
            /// address is reserved and used as the Dataproc Metastore service's
            /// endpoint. It is accessible to hosts in the subnet and to all
            /// hosts in a subnet in the same region and same network. There must
            /// be at least one IP address available in the subnet's primary range. The
            /// subnet is specified in the following form:
            ///
            /// `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}`
            Subnetwork(std::string::String),
        }
    }
}

/// Telemetry Configuration for the Dataproc Metastore service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TelemetryConfig {
    /// The output format of the Dataproc Metastore service's logs.
    pub log_format: crate::model::telemetry_config::LogFormat,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TelemetryConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [log_format][crate::model::TelemetryConfig::log_format].
    pub fn set_log_format<T: std::convert::Into<crate::model::telemetry_config::LogFormat>>(
        mut self,
        v: T,
    ) -> Self {
        self.log_format = v.into();
        self
    }
}

impl wkt::message::Message for TelemetryConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.TelemetryConfig"
    }
}

/// Defines additional types related to [TelemetryConfig].
pub mod telemetry_config {
    #[allow(unused_imports)]
    use super::*;

    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum LogFormat {
        /// The LOG_FORMAT is not set.
        Unspecified,
        /// Logging output uses the legacy `textPayload` format.
        Legacy,
        /// Logging output uses the `jsonPayload` format.
        Json,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [LogFormat::value] or
        /// [LogFormat::name].
        UnknownValue(log_format::UnknownValue),
    }

    #[doc(hidden)]
    pub mod log_format {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl LogFormat {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Legacy => std::option::Option::Some(1),
                Self::Json => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("LOG_FORMAT_UNSPECIFIED"),
                Self::Legacy => std::option::Option::Some("LEGACY"),
                Self::Json => std::option::Option::Some("JSON"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for LogFormat {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for LogFormat {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for LogFormat {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Legacy,
                2 => Self::Json,
                _ => Self::UnknownValue(log_format::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for LogFormat {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "LOG_FORMAT_UNSPECIFIED" => Self::Unspecified,
                "LEGACY" => Self::Legacy,
                "JSON" => Self::Json,
                _ => Self::UnknownValue(log_format::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for LogFormat {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Legacy => serializer.serialize_i32(1),
                Self::Json => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for LogFormat {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LogFormat>::new(
                ".google.cloud.metastore.v1.TelemetryConfig.LogFormat",
            ))
        }
    }
}

/// The metadata management activities of the metastore service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetadataManagementActivity {
    /// Output only. The latest metadata exports of the metastore service.
    pub metadata_exports: std::vec::Vec<crate::model::MetadataExport>,

    /// Output only. The latest restores of the metastore service.
    pub restores: std::vec::Vec<crate::model::Restore>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MetadataManagementActivity {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [metadata_exports][crate::model::MetadataManagementActivity::metadata_exports].
    pub fn set_metadata_exports<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::MetadataExport>,
    {
        use std::iter::Iterator;
        self.metadata_exports = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [restores][crate::model::MetadataManagementActivity::restores].
    pub fn set_restores<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Restore>,
    {
        use std::iter::Iterator;
        self.restores = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for MetadataManagementActivity {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.MetadataManagementActivity"
    }
}

/// A metastore resource that imports metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetadataImport {
    /// Immutable. The relative resource name of the metadata import, of the form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`.
    pub name: std::string::String,

    /// The description of the metadata import.
    pub description: std::string::String,

    /// Output only. The time when the metadata import was started.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the metadata import was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the metadata import finished.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The current state of the metadata import.
    pub state: crate::model::metadata_import::State,

    /// The metadata to be imported.
    pub metadata: std::option::Option<crate::model::metadata_import::Metadata>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MetadataImport {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::MetadataImport::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::MetadataImport::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::MetadataImport::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::MetadataImport::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::MetadataImport::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::MetadataImport::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::MetadataImport::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::MetadataImport::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::MetadataImport::state].
    pub fn set_state<T: std::convert::Into<crate::model::metadata_import::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [metadata][crate::model::MetadataImport::metadata].
    ///
    /// Note that all the setters affecting `metadata` are mutually
    /// exclusive.
    pub fn set_metadata<
        T: std::convert::Into<std::option::Option<crate::model::metadata_import::Metadata>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.metadata = v.into();
        self
    }

    /// The value of [metadata][crate::model::MetadataImport::metadata]
    /// if it holds a `DatabaseDump`, `None` if the field is not set or
    /// holds a different branch.
    pub fn database_dump(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::metadata_import::DatabaseDump>> {
        #[allow(unreachable_patterns)]
        self.metadata.as_ref().and_then(|v| match v {
            crate::model::metadata_import::Metadata::DatabaseDump(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [metadata][crate::model::MetadataImport::metadata]
    /// to hold a `DatabaseDump`.
    ///
    /// Note that all the setters affecting `metadata` are
    /// mutually exclusive.
    pub fn set_database_dump<
        T: std::convert::Into<std::boxed::Box<crate::model::metadata_import::DatabaseDump>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.metadata = std::option::Option::Some(
            crate::model::metadata_import::Metadata::DatabaseDump(v.into()),
        );
        self
    }
}

impl wkt::message::Message for MetadataImport {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.MetadataImport"
    }
}

/// Defines additional types related to [MetadataImport].
pub mod metadata_import {
    #[allow(unused_imports)]
    use super::*;

    /// A specification of the location of and metadata about a database dump from
    /// a relational database management system.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DatabaseDump {
        /// The type of the database.
        #[deprecated]
        pub database_type: crate::model::metadata_import::database_dump::DatabaseType,

        /// A Cloud Storage object or folder URI that specifies the source from which
        /// to import metadata. It must begin with `gs://`.
        pub gcs_uri: std::string::String,

        /// The name of the source database.
        #[deprecated]
        pub source_database: std::string::String,

        /// Optional. The type of the database dump. If unspecified, defaults to
        /// `MYSQL`.
        pub r#type: crate::model::database_dump_spec::Type,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DatabaseDump {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [database_type][crate::model::metadata_import::DatabaseDump::database_type].
        #[deprecated]
        pub fn set_database_type<
            T: std::convert::Into<crate::model::metadata_import::database_dump::DatabaseType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.database_type = v.into();
            self
        }

        /// Sets the value of [gcs_uri][crate::model::metadata_import::DatabaseDump::gcs_uri].
        pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.gcs_uri = v.into();
            self
        }

        /// Sets the value of [source_database][crate::model::metadata_import::DatabaseDump::source_database].
        #[deprecated]
        pub fn set_source_database<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.source_database = v.into();
            self
        }

        /// Sets the value of [r#type][crate::model::metadata_import::DatabaseDump::type].
        pub fn set_type<T: std::convert::Into<crate::model::database_dump_spec::Type>>(
            mut self,
            v: T,
        ) -> Self {
            self.r#type = v.into();
            self
        }
    }

    impl wkt::message::Message for DatabaseDump {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.metastore.v1.MetadataImport.DatabaseDump"
        }
    }

    /// Defines additional types related to [DatabaseDump].
    pub mod database_dump {
        #[allow(unused_imports)]
        use super::*;

        /// The type of the database.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum DatabaseType {
            /// The type of the source database is unknown.
            Unspecified,
            /// The type of the source database is MySQL.
            Mysql,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [DatabaseType::value] or
            /// [DatabaseType::name].
            UnknownValue(database_type::UnknownValue),
        }

        #[doc(hidden)]
        pub mod database_type {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl DatabaseType {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Mysql => std::option::Option::Some(1),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
                    Self::Mysql => std::option::Option::Some("MYSQL"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for DatabaseType {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for DatabaseType {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for DatabaseType {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Mysql,
                    _ => Self::UnknownValue(database_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for DatabaseType {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
                    "MYSQL" => Self::Mysql,
                    _ => Self::UnknownValue(database_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for DatabaseType {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Mysql => serializer.serialize_i32(1),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for DatabaseType {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
                    ".google.cloud.metastore.v1.MetadataImport.DatabaseDump.DatabaseType",
                ))
            }
        }
    }

    /// The current state of the metadata import.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The state of the metadata import is unknown.
        Unspecified,
        /// The metadata import is running.
        Running,
        /// The metadata import completed successfully.
        Succeeded,
        /// The metadata import is being updated.
        Updating,
        /// The metadata import failed, and attempted metadata changes were rolled
        /// back.
        Failed,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Running => std::option::Option::Some(1),
                Self::Succeeded => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Failed => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Running => std::option::Option::Some("RUNNING"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Running,
                2 => Self::Succeeded,
                3 => Self::Updating,
                4 => Self::Failed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "RUNNING" => Self::Running,
                "SUCCEEDED" => Self::Succeeded,
                "UPDATING" => Self::Updating,
                "FAILED" => Self::Failed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Running => serializer.serialize_i32(1),
                Self::Succeeded => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Failed => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.metastore.v1.MetadataImport.State",
            ))
        }
    }

    /// The metadata to be imported.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Metadata {
        /// Immutable. A database dump from a pre-existing metastore's database.
        DatabaseDump(std::boxed::Box<crate::model::metadata_import::DatabaseDump>),
    }
}

/// The details of a metadata export operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MetadataExport {
    /// Output only. The time when the export started.
    pub start_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the export ended.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The current state of the export.
    pub state: crate::model::metadata_export::State,

    /// Output only. The type of the database dump.
    pub database_dump_type: crate::model::database_dump_spec::Type,

    pub destination: std::option::Option<crate::model::metadata_export::Destination>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MetadataExport {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [start_time][crate::model::MetadataExport::start_time].
    pub fn set_start_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time][crate::model::MetadataExport::start_time].
    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::MetadataExport::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::MetadataExport::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::MetadataExport::state].
    pub fn set_state<T: std::convert::Into<crate::model::metadata_export::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [database_dump_type][crate::model::MetadataExport::database_dump_type].
    pub fn set_database_dump_type<T: std::convert::Into<crate::model::database_dump_spec::Type>>(
        mut self,
        v: T,
    ) -> Self {
        self.database_dump_type = v.into();
        self
    }

    /// Sets the value of [destination][crate::model::MetadataExport::destination].
    ///
    /// Note that all the setters affecting `destination` are mutually
    /// exclusive.
    pub fn set_destination<
        T: std::convert::Into<std::option::Option<crate::model::metadata_export::Destination>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.destination = v.into();
        self
    }

    /// The value of [destination][crate::model::MetadataExport::destination]
    /// if it holds a `DestinationGcsUri`, `None` if the field is not set or
    /// holds a different branch.
    pub fn destination_gcs_uri(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.destination.as_ref().and_then(|v| match v {
            crate::model::metadata_export::Destination::DestinationGcsUri(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [destination][crate::model::MetadataExport::destination]
    /// to hold a `DestinationGcsUri`.
    ///
    /// Note that all the setters affecting `destination` are
    /// mutually exclusive.
    pub fn set_destination_gcs_uri<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination = std::option::Option::Some(
            crate::model::metadata_export::Destination::DestinationGcsUri(v.into()),
        );
        self
    }
}

impl wkt::message::Message for MetadataExport {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.MetadataExport"
    }
}

/// Defines additional types related to [MetadataExport].
pub mod metadata_export {
    #[allow(unused_imports)]
    use super::*;

    /// The current state of the metadata export.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The state of the metadata export is unknown.
        Unspecified,
        /// The metadata export is running.
        Running,
        /// The metadata export completed successfully.
        Succeeded,
        /// The metadata export failed.
        Failed,
        /// The metadata export is cancelled.
        Cancelled,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Running => std::option::Option::Some(1),
                Self::Succeeded => std::option::Option::Some(2),
                Self::Failed => std::option::Option::Some(3),
                Self::Cancelled => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Running => std::option::Option::Some("RUNNING"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::Cancelled => std::option::Option::Some("CANCELLED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Running,
                2 => Self::Succeeded,
                3 => Self::Failed,
                4 => Self::Cancelled,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "RUNNING" => Self::Running,
                "SUCCEEDED" => Self::Succeeded,
                "FAILED" => Self::Failed,
                "CANCELLED" => Self::Cancelled,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Running => serializer.serialize_i32(1),
                Self::Succeeded => serializer.serialize_i32(2),
                Self::Failed => serializer.serialize_i32(3),
                Self::Cancelled => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.metastore.v1.MetadataExport.State",
            ))
        }
    }

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Destination {
        /// Output only. A Cloud Storage URI of a folder that metadata are exported
        /// to, in the form of
        /// `gs://<bucket_name>/<path_inside_bucket>/<export_folder>`, where
        /// `<export_folder>` is automatically generated.
        DestinationGcsUri(std::string::String),
    }
}

/// The details of a backup resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Backup {
    /// Immutable. The relative resource name of the backup, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`
    pub name: std::string::String,

    /// Output only. The time when the backup was started.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the backup finished creating.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The current state of the backup.
    pub state: crate::model::backup::State,

    /// Output only. The revision of the service at the time of backup.
    pub service_revision: std::option::Option<crate::model::Service>,

    /// The description of the backup.
    pub description: std::string::String,

    /// Output only. Services that are restoring from the backup.
    pub restoring_services: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Backup {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Backup::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Backup::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::Backup::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::Backup::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::Backup::state].
    pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [service_revision][crate::model::Backup::service_revision].
    pub fn set_service_revision<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service_revision = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_revision][crate::model::Backup::service_revision].
    pub fn set_or_clear_service_revision<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service_revision = v.map(|x| x.into());
        self
    }

    /// Sets the value of [description][crate::model::Backup::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [restoring_services][crate::model::Backup::restoring_services].
    pub fn set_restoring_services<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.restoring_services = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for Backup {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.Backup"
    }
}

/// Defines additional types related to [Backup].
pub mod backup {
    #[allow(unused_imports)]
    use super::*;

    /// The current state of the backup.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The state of the backup is unknown.
        Unspecified,
        /// The backup is being created.
        Creating,
        /// The backup is being deleted.
        Deleting,
        /// The backup is active and ready to use.
        Active,
        /// The backup failed.
        Failed,
        /// The backup is being restored.
        Restoring,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Deleting => std::option::Option::Some(2),
                Self::Active => std::option::Option::Some(3),
                Self::Failed => std::option::Option::Some(4),
                Self::Restoring => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::Restoring => std::option::Option::Some("RESTORING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Deleting,
                3 => Self::Active,
                4 => Self::Failed,
                5 => Self::Restoring,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "DELETING" => Self::Deleting,
                "ACTIVE" => Self::Active,
                "FAILED" => Self::Failed,
                "RESTORING" => Self::Restoring,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Deleting => serializer.serialize_i32(2),
                Self::Active => serializer.serialize_i32(3),
                Self::Failed => serializer.serialize_i32(4),
                Self::Restoring => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.metastore.v1.Backup.State",
            ))
        }
    }
}

/// The details of a metadata restore operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Restore {
    /// Output only. The time when the restore started.
    pub start_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the restore ended.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The current state of the restore.
    pub state: crate::model::restore::State,

    /// Output only. The relative resource name of the metastore service backup to
    /// restore from, in the following form:
    ///
    /// `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
    pub backup: std::string::String,

    /// Output only. The type of restore.
    pub r#type: crate::model::restore::RestoreType,

    /// Output only. The restore details containing the revision of the service to
    /// be restored to, in format of JSON.
    pub details: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Restore {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [start_time][crate::model::Restore::start_time].
    pub fn set_start_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start_time][crate::model::Restore::start_time].
    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.start_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::Restore::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::Restore::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::Restore::state].
    pub fn set_state<T: std::convert::Into<crate::model::restore::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [backup][crate::model::Restore::backup].
    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.backup = v.into();
        self
    }

    /// Sets the value of [r#type][crate::model::Restore::type].
    pub fn set_type<T: std::convert::Into<crate::model::restore::RestoreType>>(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [details][crate::model::Restore::details].
    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.details = v.into();
        self
    }
}

impl wkt::message::Message for Restore {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.Restore"
    }
}

/// Defines additional types related to [Restore].
pub mod restore {
    #[allow(unused_imports)]
    use super::*;

    /// The current state of the restore.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The state of the metadata restore is unknown.
        Unspecified,
        /// The metadata restore is running.
        Running,
        /// The metadata restore completed successfully.
        Succeeded,
        /// The metadata restore failed.
        Failed,
        /// The metadata restore is cancelled.
        Cancelled,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Running => std::option::Option::Some(1),
                Self::Succeeded => std::option::Option::Some(2),
                Self::Failed => std::option::Option::Some(3),
                Self::Cancelled => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Running => std::option::Option::Some("RUNNING"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::Cancelled => std::option::Option::Some("CANCELLED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Running,
                2 => Self::Succeeded,
                3 => Self::Failed,
                4 => Self::Cancelled,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "RUNNING" => Self::Running,
                "SUCCEEDED" => Self::Succeeded,
                "FAILED" => Self::Failed,
                "CANCELLED" => Self::Cancelled,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Running => serializer.serialize_i32(1),
                Self::Succeeded => serializer.serialize_i32(2),
                Self::Failed => serializer.serialize_i32(3),
                Self::Cancelled => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.metastore.v1.Restore.State",
            ))
        }
    }

    /// The type of restore. If unspecified, defaults to `METADATA_ONLY`.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum RestoreType {
        /// The restore type is unknown.
        Unspecified,
        /// The service's metadata and configuration are restored.
        Full,
        /// Only the service's metadata is restored.
        MetadataOnly,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [RestoreType::value] or
        /// [RestoreType::name].
        UnknownValue(restore_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod restore_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl RestoreType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Full => std::option::Option::Some(1),
                Self::MetadataOnly => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("RESTORE_TYPE_UNSPECIFIED"),
                Self::Full => std::option::Option::Some("FULL"),
                Self::MetadataOnly => std::option::Option::Some("METADATA_ONLY"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for RestoreType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for RestoreType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for RestoreType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Full,
                2 => Self::MetadataOnly,
                _ => Self::UnknownValue(restore_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for RestoreType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "RESTORE_TYPE_UNSPECIFIED" => Self::Unspecified,
                "FULL" => Self::Full,
                "METADATA_ONLY" => Self::MetadataOnly,
                _ => Self::UnknownValue(restore_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for RestoreType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Full => serializer.serialize_i32(1),
                Self::MetadataOnly => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for RestoreType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestoreType>::new(
                ".google.cloud.metastore.v1.Restore.RestoreType",
            ))
        }
    }
}

/// Represents the scaling configuration of a metastore service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScalingConfig {
    /// Represents either a predetermined instance size or a numeric
    /// scaling factor.
    pub scaling_model: std::option::Option<crate::model::scaling_config::ScalingModel>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ScalingConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [scaling_model][crate::model::ScalingConfig::scaling_model].
    ///
    /// Note that all the setters affecting `scaling_model` are mutually
    /// exclusive.
    pub fn set_scaling_model<
        T: std::convert::Into<std::option::Option<crate::model::scaling_config::ScalingModel>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.scaling_model = v.into();
        self
    }

    /// The value of [scaling_model][crate::model::ScalingConfig::scaling_model]
    /// if it holds a `InstanceSize`, `None` if the field is not set or
    /// holds a different branch.
    pub fn instance_size(
        &self,
    ) -> std::option::Option<&crate::model::scaling_config::InstanceSize> {
        #[allow(unreachable_patterns)]
        self.scaling_model.as_ref().and_then(|v| match v {
            crate::model::scaling_config::ScalingModel::InstanceSize(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [scaling_model][crate::model::ScalingConfig::scaling_model]
    /// to hold a `InstanceSize`.
    ///
    /// Note that all the setters affecting `scaling_model` are
    /// mutually exclusive.
    pub fn set_instance_size<T: std::convert::Into<crate::model::scaling_config::InstanceSize>>(
        mut self,
        v: T,
    ) -> Self {
        self.scaling_model = std::option::Option::Some(
            crate::model::scaling_config::ScalingModel::InstanceSize(v.into()),
        );
        self
    }

    /// The value of [scaling_model][crate::model::ScalingConfig::scaling_model]
    /// if it holds a `ScalingFactor`, `None` if the field is not set or
    /// holds a different branch.
    pub fn scaling_factor(&self) -> std::option::Option<&f32> {
        #[allow(unreachable_patterns)]
        self.scaling_model.as_ref().and_then(|v| match v {
            crate::model::scaling_config::ScalingModel::ScalingFactor(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [scaling_model][crate::model::ScalingConfig::scaling_model]
    /// to hold a `ScalingFactor`.
    ///
    /// Note that all the setters affecting `scaling_model` are
    /// mutually exclusive.
    pub fn set_scaling_factor<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
        self.scaling_model = std::option::Option::Some(
            crate::model::scaling_config::ScalingModel::ScalingFactor(v.into()),
        );
        self
    }
}

impl wkt::message::Message for ScalingConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ScalingConfig"
    }
}

/// Defines additional types related to [ScalingConfig].
pub mod scaling_config {
    #[allow(unused_imports)]
    use super::*;

    /// Metastore instance sizes.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum InstanceSize {
        /// Unspecified instance size
        Unspecified,
        /// Extra small instance size, maps to a scaling factor of 0.1.
        ExtraSmall,
        /// Small instance size, maps to a scaling factor of 0.5.
        Small,
        /// Medium instance size, maps to a scaling factor of 1.0.
        Medium,
        /// Large instance size, maps to a scaling factor of 3.0.
        Large,
        /// Extra large instance size, maps to a scaling factor of 6.0.
        ExtraLarge,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [InstanceSize::value] or
        /// [InstanceSize::name].
        UnknownValue(instance_size::UnknownValue),
    }

    #[doc(hidden)]
    pub mod instance_size {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl InstanceSize {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::ExtraSmall => std::option::Option::Some(1),
                Self::Small => std::option::Option::Some(2),
                Self::Medium => std::option::Option::Some(3),
                Self::Large => std::option::Option::Some(4),
                Self::ExtraLarge => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("INSTANCE_SIZE_UNSPECIFIED"),
                Self::ExtraSmall => std::option::Option::Some("EXTRA_SMALL"),
                Self::Small => std::option::Option::Some("SMALL"),
                Self::Medium => std::option::Option::Some("MEDIUM"),
                Self::Large => std::option::Option::Some("LARGE"),
                Self::ExtraLarge => std::option::Option::Some("EXTRA_LARGE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for InstanceSize {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for InstanceSize {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for InstanceSize {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::ExtraSmall,
                2 => Self::Small,
                3 => Self::Medium,
                4 => Self::Large,
                5 => Self::ExtraLarge,
                _ => Self::UnknownValue(instance_size::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for InstanceSize {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "INSTANCE_SIZE_UNSPECIFIED" => Self::Unspecified,
                "EXTRA_SMALL" => Self::ExtraSmall,
                "SMALL" => Self::Small,
                "MEDIUM" => Self::Medium,
                "LARGE" => Self::Large,
                "EXTRA_LARGE" => Self::ExtraLarge,
                _ => Self::UnknownValue(instance_size::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for InstanceSize {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::ExtraSmall => serializer.serialize_i32(1),
                Self::Small => serializer.serialize_i32(2),
                Self::Medium => serializer.serialize_i32(3),
                Self::Large => serializer.serialize_i32(4),
                Self::ExtraLarge => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for InstanceSize {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<InstanceSize>::new(
                ".google.cloud.metastore.v1.ScalingConfig.InstanceSize",
            ))
        }
    }

    /// Represents either a predetermined instance size or a numeric
    /// scaling factor.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ScalingModel {
        /// An enum of readable instance sizes, with each instance size mapping to a
        /// float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1))
        InstanceSize(crate::model::scaling_config::InstanceSize),
        /// Scaling factor, increments of 0.1 for values less than 1.0, and
        /// increments of 1.0 for values greater than 1.0.
        ScalingFactor(f32),
    }
}

/// Request message for
/// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
///
/// [google.cloud.metastore.v1.DataprocMetastore.ListServices]: crate::client::DataprocMetastore::list_services
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServicesRequest {
    /// Required. The relative resource name of the location of metastore services
    /// to list, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}`.
    pub parent: std::string::String,

    /// Optional. The maximum number of services to return. The response may
    /// contain less than the maximum number. If unspecified, no more than 500
    /// services are returned. The maximum value is 1000; values above 1000 are
    /// changed to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous
    /// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
    /// call. Provide this token to retrieve the subsequent page.
    ///
    /// To retrieve the first page, supply an empty page token.
    ///
    /// When paginating, other parameters provided to
    /// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
    /// must match the call that provided the page token.
    ///
    /// [google.cloud.metastore.v1.DataprocMetastore.ListServices]: crate::client::DataprocMetastore::list_services
    pub page_token: std::string::String,

    /// Optional. The filter to apply to list results.
    pub filter: std::string::String,

    /// Optional. Specify the ordering of results as described in [Sorting
    /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
    /// If not specified, the results will be sorted in the default order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServicesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListServicesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListServicesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListServicesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ListServicesRequest"
    }
}

/// Response message for
/// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
///
/// [google.cloud.metastore.v1.DataprocMetastore.ListServices]: crate::client::DataprocMetastore::list_services
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServicesResponse {
    /// The services in the specified location.
    pub services: std::vec::Vec<crate::model::Service>,

    /// A token that can be sent as `page_token` to retrieve the next page. If this
    /// field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServicesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [services][crate::model::ListServicesResponse::services].
    pub fn set_services<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Service>,
    {
        use std::iter::Iterator;
        self.services = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListServicesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListServicesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ListServicesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListServicesResponse {
    type PageItem = crate::model::Service;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.services
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for
/// [DataprocMetastore.GetService][google.cloud.metastore.v1.DataprocMetastore.GetService].
///
/// [google.cloud.metastore.v1.DataprocMetastore.GetService]: crate::client::DataprocMetastore::get_service
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceRequest {
    /// Required. The relative resource name of the metastore service to retrieve,
    /// in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetServiceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.GetServiceRequest"
    }
}

/// Request message for
/// [DataprocMetastore.CreateService][google.cloud.metastore.v1.DataprocMetastore.CreateService].
///
/// [google.cloud.metastore.v1.DataprocMetastore.CreateService]: crate::client::DataprocMetastore::create_service
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceRequest {
    /// Required. The relative resource name of the location in which to create a
    /// metastore service, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}`.
    pub parent: std::string::String,

    /// Required. The ID of the metastore service, which is used as the final
    /// component of the metastore service's name.
    ///
    /// This value must be between 2 and 63 characters long inclusive, begin with a
    /// letter, end with a letter or number, and consist of alpha-numeric
    /// ASCII characters or hyphens.
    pub service_id: std::string::String,

    /// Required. The Metastore service to create. The `name` field is
    /// ignored. The ID of the created metastore service must be provided in
    /// the request's `service_id` field.
    pub service: std::option::Option<crate::model::Service>,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateServiceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [service_id][crate::model::CreateServiceRequest::service_id].
    pub fn set_service_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_id = v.into();
        self
    }

    /// Sets the value of [service][crate::model::CreateServiceRequest::service].
    pub fn set_service<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service][crate::model::CreateServiceRequest::service].
    pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateServiceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.CreateServiceRequest"
    }
}

/// Request message for
/// [DataprocMetastore.UpdateService][google.cloud.metastore.v1.DataprocMetastore.UpdateService].
///
/// [google.cloud.metastore.v1.DataprocMetastore.UpdateService]: crate::client::DataprocMetastore::update_service
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceRequest {
    /// Required. A field mask used to specify the fields to be overwritten in the
    /// metastore service resource by the update.
    /// Fields specified in the `update_mask` are relative to the resource (not
    /// to the full request). A field is overwritten if it is in the mask.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The metastore service to update. The server only merges fields
    /// in the service if they are specified in `update_mask`.
    ///
    /// The metastore service's `name` field is used to identify the metastore
    /// service to be updated.
    pub service: std::option::Option<crate::model::Service>,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
    pub fn set_service<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
    pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateServiceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.UpdateServiceRequest"
    }
}

/// Request message for
/// [DataprocMetastore.DeleteService][google.cloud.metastore.v1.DataprocMetastore.DeleteService].
///
/// [google.cloud.metastore.v1.DataprocMetastore.DeleteService]: crate::client::DataprocMetastore::delete_service
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceRequest {
    /// Required. The relative resource name of the metastore service to delete, in
    /// the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
    pub name: std::string::String,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteServiceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.DeleteServiceRequest"
    }
}

/// Request message for
/// [DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
///
/// [google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports]: crate::client::DataprocMetastore::list_metadata_imports
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMetadataImportsRequest {
    /// Required. The relative resource name of the service whose metadata imports
    /// to list, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`.
    pub parent: std::string::String,

    /// Optional. The maximum number of imports to return. The response may contain
    /// less than the maximum number. If unspecified, no more than 500 imports are
    /// returned. The maximum value is 1000; values above 1000 are changed to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous
    /// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
    /// call. Provide this token to retrieve the subsequent page.
    ///
    /// To retrieve the first page, supply an empty page token.
    ///
    /// When paginating, other parameters provided to
    /// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
    /// must match the call that provided the page token.
    ///
    /// [google.cloud.metastore.v1.DataprocMetastore.ListServices]: crate::client::DataprocMetastore::list_services
    pub page_token: std::string::String,

    /// Optional. The filter to apply to list results.
    pub filter: std::string::String,

    /// Optional. Specify the ordering of results as described in [Sorting
    /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
    /// If not specified, the results will be sorted in the default order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListMetadataImportsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListMetadataImportsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListMetadataImportsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListMetadataImportsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListMetadataImportsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListMetadataImportsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListMetadataImportsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ListMetadataImportsRequest"
    }
}

/// Response message for
/// [DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
///
/// [google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports]: crate::client::DataprocMetastore::list_metadata_imports
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMetadataImportsResponse {
    /// The imports in the specified service.
    pub metadata_imports: std::vec::Vec<crate::model::MetadataImport>,

    /// A token that can be sent as `page_token` to retrieve the next page. If this
    /// field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListMetadataImportsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [metadata_imports][crate::model::ListMetadataImportsResponse::metadata_imports].
    pub fn set_metadata_imports<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::MetadataImport>,
    {
        use std::iter::Iterator;
        self.metadata_imports = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListMetadataImportsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListMetadataImportsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListMetadataImportsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ListMetadataImportsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListMetadataImportsResponse {
    type PageItem = crate::model::MetadataImport;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.metadata_imports
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for
/// [DataprocMetastore.GetMetadataImport][google.cloud.metastore.v1.DataprocMetastore.GetMetadataImport].
///
/// [google.cloud.metastore.v1.DataprocMetastore.GetMetadataImport]: crate::client::DataprocMetastore::get_metadata_import
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMetadataImportRequest {
    /// Required. The relative resource name of the metadata import to retrieve, in
    /// the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetMetadataImportRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetMetadataImportRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetMetadataImportRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.GetMetadataImportRequest"
    }
}

/// Request message for
/// [DataprocMetastore.CreateMetadataImport][google.cloud.metastore.v1.DataprocMetastore.CreateMetadataImport].
///
/// [google.cloud.metastore.v1.DataprocMetastore.CreateMetadataImport]: crate::client::DataprocMetastore::create_metadata_import
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMetadataImportRequest {
    /// Required. The relative resource name of the service in which to create a
    /// metastore import, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
    pub parent: std::string::String,

    /// Required. The ID of the metadata import, which is used as the final
    /// component of the metadata import's name.
    ///
    /// This value must be between 1 and 64 characters long, begin with a letter,
    /// end with a letter or number, and consist of alpha-numeric ASCII characters
    /// or hyphens.
    pub metadata_import_id: std::string::String,

    /// Required. The metadata import to create. The `name` field is ignored. The
    /// ID of the created metadata import must be provided in the request's
    /// `metadata_import_id` field.
    pub metadata_import: std::option::Option<crate::model::MetadataImport>,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateMetadataImportRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateMetadataImportRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [metadata_import_id][crate::model::CreateMetadataImportRequest::metadata_import_id].
    pub fn set_metadata_import_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.metadata_import_id = v.into();
        self
    }

    /// Sets the value of [metadata_import][crate::model::CreateMetadataImportRequest::metadata_import].
    pub fn set_metadata_import<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::MetadataImport>,
    {
        self.metadata_import = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [metadata_import][crate::model::CreateMetadataImportRequest::metadata_import].
    pub fn set_or_clear_metadata_import<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::MetadataImport>,
    {
        self.metadata_import = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateMetadataImportRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateMetadataImportRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.CreateMetadataImportRequest"
    }
}

/// Request message for
/// [DataprocMetastore.UpdateMetadataImport][google.cloud.metastore.v1.DataprocMetastore.UpdateMetadataImport].
///
/// [google.cloud.metastore.v1.DataprocMetastore.UpdateMetadataImport]: crate::client::DataprocMetastore::update_metadata_import
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMetadataImportRequest {
    /// Required. A field mask used to specify the fields to be overwritten in the
    /// metadata import resource by the update.
    /// Fields specified in the `update_mask` are relative to the resource (not
    /// to the full request). A field is overwritten if it is in the mask.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The metadata import to update. The server only merges fields
    /// in the import if they are specified in `update_mask`.
    ///
    /// The metadata import's `name` field is used to identify the metastore
    /// import to be updated.
    pub metadata_import: std::option::Option<crate::model::MetadataImport>,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateMetadataImportRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateMetadataImportRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateMetadataImportRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [metadata_import][crate::model::UpdateMetadataImportRequest::metadata_import].
    pub fn set_metadata_import<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::MetadataImport>,
    {
        self.metadata_import = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [metadata_import][crate::model::UpdateMetadataImportRequest::metadata_import].
    pub fn set_or_clear_metadata_import<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::MetadataImport>,
    {
        self.metadata_import = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateMetadataImportRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateMetadataImportRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.UpdateMetadataImportRequest"
    }
}

/// Request message for
/// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
///
/// [google.cloud.metastore.v1.DataprocMetastore.ListBackups]: crate::client::DataprocMetastore::list_backups
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsRequest {
    /// Required. The relative resource name of the service whose backups to
    /// list, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`.
    pub parent: std::string::String,

    /// Optional. The maximum number of backups to return. The response may contain
    /// less than the maximum number. If unspecified, no more than 500 backups are
    /// returned. The maximum value is 1000; values above 1000 are changed to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous
    /// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups]
    /// call. Provide this token to retrieve the subsequent page.
    ///
    /// To retrieve the first page, supply an empty page token.
    ///
    /// When paginating, other parameters provided to
    /// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups]
    /// must match the call that provided the page token.
    ///
    /// [google.cloud.metastore.v1.DataprocMetastore.ListBackups]: crate::client::DataprocMetastore::list_backups
    pub page_token: std::string::String,

    /// Optional. The filter to apply to list results.
    pub filter: std::string::String,

    /// Optional. Specify the ordering of results as described in [Sorting
    /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
    /// If not specified, the results will be sorted in the default order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListBackupsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListBackupsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ListBackupsRequest"
    }
}

/// Response message for
/// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
///
/// [google.cloud.metastore.v1.DataprocMetastore.ListBackups]: crate::client::DataprocMetastore::list_backups
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBackupsResponse {
    /// The backups of the specified service.
    pub backups: std::vec::Vec<crate::model::Backup>,

    /// A token that can be sent as `page_token` to retrieve the next page. If this
    /// field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListBackupsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
    pub fn set_backups<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Backup>,
    {
        use std::iter::Iterator;
        self.backups = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListBackupsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ListBackupsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListBackupsResponse {
    type PageItem = crate::model::Backup;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.backups
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for
/// [DataprocMetastore.GetBackup][google.cloud.metastore.v1.DataprocMetastore.GetBackup].
///
/// [google.cloud.metastore.v1.DataprocMetastore.GetBackup]: crate::client::DataprocMetastore::get_backup
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBackupRequest {
    /// Required. The relative resource name of the backup to retrieve, in the
    /// following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetBackupRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetBackupRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetBackupRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.GetBackupRequest"
    }
}

/// Request message for
/// [DataprocMetastore.CreateBackup][google.cloud.metastore.v1.DataprocMetastore.CreateBackup].
///
/// [google.cloud.metastore.v1.DataprocMetastore.CreateBackup]: crate::client::DataprocMetastore::create_backup
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBackupRequest {
    /// Required. The relative resource name of the service in which to create a
    /// backup of the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
    pub parent: std::string::String,

    /// Required. The ID of the backup, which is used as the final component of the
    /// backup's name.
    ///
    /// This value must be between 1 and 64 characters long, begin with a letter,
    /// end with a letter or number, and consist of alpha-numeric ASCII characters
    /// or hyphens.
    pub backup_id: std::string::String,

    /// Required. The backup to create. The `name` field is ignored. The ID of the
    /// created backup must be provided in the request's `backup_id` field.
    pub backup: std::option::Option<crate::model::Backup>,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateBackupRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
    pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.backup_id = v.into();
        self
    }

    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
    pub fn set_backup<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Backup>,
    {
        self.backup = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Backup>,
    {
        self.backup = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateBackupRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateBackupRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.CreateBackupRequest"
    }
}

/// Request message for
/// [DataprocMetastore.DeleteBackup][google.cloud.metastore.v1.DataprocMetastore.DeleteBackup].
///
/// [google.cloud.metastore.v1.DataprocMetastore.DeleteBackup]: crate::client::DataprocMetastore::delete_backup
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBackupRequest {
    /// Required. The relative resource name of the backup to delete, in the
    /// following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
    pub name: std::string::String,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteBackupRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteBackupRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteBackupRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.DeleteBackupRequest"
    }
}

/// Request message for
/// [DataprocMetastore.ExportMetadata][google.cloud.metastore.v1.DataprocMetastore.ExportMetadata].
///
/// [google.cloud.metastore.v1.DataprocMetastore.ExportMetadata]: crate::client::DataprocMetastore::export_metadata
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExportMetadataRequest {
    /// Required. The relative resource name of the metastore service to run
    /// export, in the following form:
    ///
    /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
    pub service: std::string::String,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    /// Optional. The type of the database dump. If unspecified, defaults to
    /// `MYSQL`.
    pub database_dump_type: crate::model::database_dump_spec::Type,

    /// Required. Destination that metadata is exported to.
    pub destination: std::option::Option<crate::model::export_metadata_request::Destination>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExportMetadataRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service][crate::model::ExportMetadataRequest::service].
    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::ExportMetadataRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [database_dump_type][crate::model::ExportMetadataRequest::database_dump_type].
    pub fn set_database_dump_type<T: std::convert::Into<crate::model::database_dump_spec::Type>>(
        mut self,
        v: T,
    ) -> Self {
        self.database_dump_type = v.into();
        self
    }

    /// Sets the value of [destination][crate::model::ExportMetadataRequest::destination].
    ///
    /// Note that all the setters affecting `destination` are mutually
    /// exclusive.
    pub fn set_destination<
        T: std::convert::Into<std::option::Option<crate::model::export_metadata_request::Destination>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.destination = v.into();
        self
    }

    /// The value of [destination][crate::model::ExportMetadataRequest::destination]
    /// if it holds a `DestinationGcsFolder`, `None` if the field is not set or
    /// holds a different branch.
    pub fn destination_gcs_folder(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.destination.as_ref().and_then(|v| match v {
            crate::model::export_metadata_request::Destination::DestinationGcsFolder(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [destination][crate::model::ExportMetadataRequest::destination]
    /// to hold a `DestinationGcsFolder`.
    ///
    /// Note that all the setters affecting `destination` are
    /// mutually exclusive.
    pub fn set_destination_gcs_folder<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination = std::option::Option::Some(
            crate::model::export_metadata_request::Destination::DestinationGcsFolder(v.into()),
        );
        self
    }
}

impl wkt::message::Message for ExportMetadataRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ExportMetadataRequest"
    }
}

/// Defines additional types related to [ExportMetadataRequest].
pub mod export_metadata_request {
    #[allow(unused_imports)]
    use super::*;

    /// Required. Destination that metadata is exported to.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Destination {
        /// A Cloud Storage URI of a folder, in the format
        /// `gs://<bucket_name>/<path_inside_bucket>`. A sub-folder
        /// `<export_folder>` containing exported files will be created below it.
        DestinationGcsFolder(std::string::String),
    }
}

/// Request message for [DataprocMetastore.Restore][].
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreServiceRequest {
    /// Required. The relative resource name of the metastore service to run
    /// restore, in the following form:
    ///
    /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
    pub service: std::string::String,

    /// Required. The relative resource name of the metastore service backup to
    /// restore from, in the following form:
    ///
    /// `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
    pub backup: std::string::String,

    /// Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`.
    pub restore_type: crate::model::restore::RestoreType,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RestoreServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service][crate::model::RestoreServiceRequest::service].
    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service = v.into();
        self
    }

    /// Sets the value of [backup][crate::model::RestoreServiceRequest::backup].
    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.backup = v.into();
        self
    }

    /// Sets the value of [restore_type][crate::model::RestoreServiceRequest::restore_type].
    pub fn set_restore_type<T: std::convert::Into<crate::model::restore::RestoreType>>(
        mut self,
        v: T,
    ) -> Self {
        self.restore_type = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::RestoreServiceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for RestoreServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.RestoreServiceRequest"
    }
}

/// Represents the metadata of a long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the caller has requested cancellation
    /// of the operation. Operations that have successfully been cancelled
    /// have [Operation.error][] value with a
    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
    /// `Code.CANCELLED`.
    ///
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.OperationMetadata"
    }
}

/// Metadata about the service in a location.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocationMetadata {
    /// The versions of Hive Metastore that can be used when creating a new
    /// metastore service in this location. The server guarantees that exactly one
    /// `HiveMetastoreVersion` in the list will set `is_default`.
    pub supported_hive_metastore_versions:
        std::vec::Vec<crate::model::location_metadata::HiveMetastoreVersion>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LocationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [supported_hive_metastore_versions][crate::model::LocationMetadata::supported_hive_metastore_versions].
    pub fn set_supported_hive_metastore_versions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::location_metadata::HiveMetastoreVersion>,
    {
        use std::iter::Iterator;
        self.supported_hive_metastore_versions = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for LocationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.LocationMetadata"
    }
}

/// Defines additional types related to [LocationMetadata].
pub mod location_metadata {
    #[allow(unused_imports)]
    use super::*;

    /// A specification of a supported version of the Hive Metastore software.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct HiveMetastoreVersion {
        /// The semantic version of the Hive Metastore software.
        pub version: std::string::String,

        /// Whether `version` will be chosen by the server if a metastore service is
        /// created with a `HiveMetastoreConfig` that omits the `version`.
        pub is_default: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl HiveMetastoreVersion {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [version][crate::model::location_metadata::HiveMetastoreVersion::version].
        pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.version = v.into();
            self
        }

        /// Sets the value of [is_default][crate::model::location_metadata::HiveMetastoreVersion::is_default].
        pub fn set_is_default<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.is_default = v.into();
            self
        }
    }

    impl wkt::message::Message for HiveMetastoreVersion {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.metastore.v1.LocationMetadata.HiveMetastoreVersion"
        }
    }
}

/// The specification of database dump to import from or export to.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DatabaseDumpSpec {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DatabaseDumpSpec {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for DatabaseDumpSpec {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.DatabaseDumpSpec"
    }
}

/// Defines additional types related to [DatabaseDumpSpec].
pub mod database_dump_spec {
    #[allow(unused_imports)]
    use super::*;

    /// The type of the database dump.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// The type of the database dump is unknown.
        Unspecified,
        /// Database dump is a MySQL dump file.
        Mysql,
        /// Database dump contains Avro files.
        Avro,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Type::value] or
        /// [Type::name].
        UnknownValue(r#type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod r#type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Type {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Mysql => std::option::Option::Some(1),
                Self::Avro => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                Self::Mysql => std::option::Option::Some("MYSQL"),
                Self::Avro => std::option::Option::Some("AVRO"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Type {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Type {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Type {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Mysql,
                2 => Self::Avro,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Type {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TYPE_UNSPECIFIED" => Self::Unspecified,
                "MYSQL" => Self::Mysql,
                "AVRO" => Self::Avro,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Type {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Mysql => serializer.serialize_i32(1),
                Self::Avro => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Type {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                ".google.cloud.metastore.v1.DatabaseDumpSpec.Type",
            ))
        }
    }
}

/// Request message for
/// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
///
/// [google.cloud.metastore.v1.DataprocMetastore.QueryMetadata]: crate::client::DataprocMetastore::query_metadata
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryMetadataRequest {
    /// Required. The relative resource name of the metastore service to query
    /// metadata, in the following format:
    ///
    /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
    pub service: std::string::String,

    /// Required. A read-only SQL query to execute against the metadata database.
    /// The query cannot change or mutate the data.
    pub query: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryMetadataRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service][crate::model::QueryMetadataRequest::service].
    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service = v.into();
        self
    }

    /// Sets the value of [query][crate::model::QueryMetadataRequest::query].
    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.query = v.into();
        self
    }
}

impl wkt::message::Message for QueryMetadataRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.QueryMetadataRequest"
    }
}

/// Response message for
/// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
///
/// [google.cloud.metastore.v1.DataprocMetastore.QueryMetadata]: crate::client::DataprocMetastore::query_metadata
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryMetadataResponse {
    /// The manifest URI  is link to a JSON instance in Cloud Storage.
    /// This instance manifests immediately along with QueryMetadataResponse. The
    /// content of the URI is not retriable until the long-running operation query
    /// against the metadata finishes.
    pub result_manifest_uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryMetadataResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [result_manifest_uri][crate::model::QueryMetadataResponse::result_manifest_uri].
    pub fn set_result_manifest_uri<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.result_manifest_uri = v.into();
        self
    }
}

impl wkt::message::Message for QueryMetadataResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.QueryMetadataResponse"
    }
}

/// Error details in public error message for
/// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
///
/// [google.cloud.metastore.v1.DataprocMetastore.QueryMetadata]: crate::client::DataprocMetastore::query_metadata
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ErrorDetails {
    /// Additional structured details about this error.
    ///
    /// Keys define the failure items.
    /// Value describes the exception or details of the item.
    pub details: std::collections::HashMap<std::string::String, std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ErrorDetails {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [details][crate::model::ErrorDetails::details].
    pub fn set_details<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for ErrorDetails {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ErrorDetails"
    }
}

/// Request message for
/// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase].
///
/// [google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase]: crate::client::DataprocMetastore::move_table_to_database
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveTableToDatabaseRequest {
    /// Required. The relative resource name of the metastore service to mutate
    /// metadata, in the following format:
    ///
    /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
    pub service: std::string::String,

    /// Required. The name of the table to be moved.
    pub table_name: std::string::String,

    /// Required. The name of the database where the table resides.
    pub db_name: std::string::String,

    /// Required. The name of the database where the table should be moved.
    pub destination_db_name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MoveTableToDatabaseRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service][crate::model::MoveTableToDatabaseRequest::service].
    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service = v.into();
        self
    }

    /// Sets the value of [table_name][crate::model::MoveTableToDatabaseRequest::table_name].
    pub fn set_table_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.table_name = v.into();
        self
    }

    /// Sets the value of [db_name][crate::model::MoveTableToDatabaseRequest::db_name].
    pub fn set_db_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.db_name = v.into();
        self
    }

    /// Sets the value of [destination_db_name][crate::model::MoveTableToDatabaseRequest::destination_db_name].
    pub fn set_destination_db_name<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_db_name = v.into();
        self
    }
}

impl wkt::message::Message for MoveTableToDatabaseRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.MoveTableToDatabaseRequest"
    }
}

/// Response message for
/// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase].
///
/// [google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase]: crate::client::DataprocMetastore::move_table_to_database
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveTableToDatabaseResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MoveTableToDatabaseResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for MoveTableToDatabaseResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.MoveTableToDatabaseResponse"
    }
}

/// Request message for
/// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation].
///
/// [google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation]: crate::client::DataprocMetastore::alter_metadata_resource_location
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AlterMetadataResourceLocationRequest {
    /// Required. The relative resource name of the metastore service to mutate
    /// metadata, in the following format:
    ///
    /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
    pub service: std::string::String,

    /// Required. The relative metadata resource name in the following format.
    ///
    /// `databases/{database_id}`
    /// or
    /// `databases/{database_id}/tables/{table_id}`
    /// or
    /// `databases/{database_id}/tables/{table_id}/partitions/{partition_id}`
    pub resource_name: std::string::String,

    /// Required. The new location URI for the metadata resource.
    pub location_uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AlterMetadataResourceLocationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service][crate::model::AlterMetadataResourceLocationRequest::service].
    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service = v.into();
        self
    }

    /// Sets the value of [resource_name][crate::model::AlterMetadataResourceLocationRequest::resource_name].
    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.resource_name = v.into();
        self
    }

    /// Sets the value of [location_uri][crate::model::AlterMetadataResourceLocationRequest::location_uri].
    pub fn set_location_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location_uri = v.into();
        self
    }
}

impl wkt::message::Message for AlterMetadataResourceLocationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.AlterMetadataResourceLocationRequest"
    }
}

/// Response message for
/// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation].
///
/// [google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation]: crate::client::DataprocMetastore::alter_metadata_resource_location
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AlterMetadataResourceLocationResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AlterMetadataResourceLocationResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for AlterMetadataResourceLocationResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.AlterMetadataResourceLocationResponse"
    }
}

/// Represents a federation of multiple backend metastores.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Federation {
    /// Immutable. The relative resource name of the federation, of the
    /// form:
    /// projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
    pub name: std::string::String,

    /// Output only. The time when the metastore federation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the metastore federation was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined labels for the metastore federation.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Immutable. The Apache Hive metastore version of the federation. All backend
    /// metastore versions must be compatible with the federation version.
    pub version: std::string::String,

    /// A map from `BackendMetastore` rank to `BackendMetastore`s from which the
    /// federation service serves metadata at query time. The map key represents
    /// the order in which `BackendMetastore`s should be evaluated to resolve
    /// database names at query time and should be greater than or equal to zero. A
    /// `BackendMetastore` with a lower number will be evaluated before a
    /// `BackendMetastore` with a higher number.
    pub backend_metastores: std::collections::HashMap<i32, crate::model::BackendMetastore>,

    /// Output only. The federation endpoint.
    pub endpoint_uri: std::string::String,

    /// Output only. The current state of the federation.
    pub state: crate::model::federation::State,

    /// Output only. Additional information about the current state of the
    /// metastore federation, if available.
    pub state_message: std::string::String,

    /// Output only. The globally unique resource identifier of the metastore
    /// federation.
    pub uid: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Federation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Federation::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Federation::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Federation::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Federation::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Federation::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Federation::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [version][crate::model::Federation::version].
    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.version = v.into();
        self
    }

    /// Sets the value of [backend_metastores][crate::model::Federation::backend_metastores].
    pub fn set_backend_metastores<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<i32>,
        V: std::convert::Into<crate::model::BackendMetastore>,
    {
        use std::iter::Iterator;
        self.backend_metastores = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [endpoint_uri][crate::model::Federation::endpoint_uri].
    pub fn set_endpoint_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.endpoint_uri = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Federation::state].
    pub fn set_state<T: std::convert::Into<crate::model::federation::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [state_message][crate::model::Federation::state_message].
    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.state_message = v.into();
        self
    }

    /// Sets the value of [uid][crate::model::Federation::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }
}

impl wkt::message::Message for Federation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.Federation"
    }
}

/// Defines additional types related to [Federation].
pub mod federation {
    #[allow(unused_imports)]
    use super::*;

    /// The current state of the federation.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The state of the metastore federation is unknown.
        Unspecified,
        /// The metastore federation is in the process of being created.
        Creating,
        /// The metastore federation is running and ready to serve queries.
        Active,
        /// The metastore federation is being updated. It remains usable but cannot
        /// accept additional update requests or be deleted at this time.
        Updating,
        /// The metastore federation is undergoing deletion. It cannot be used.
        Deleting,
        /// The metastore federation has encountered an error and cannot be used. The
        /// metastore federation should be deleted.
        Error,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Updating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::Error => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Error => std::option::Option::Some("ERROR"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Updating,
                4 => Self::Deleting,
                5 => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                "ERROR" => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Updating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::Error => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.metastore.v1.Federation.State",
            ))
        }
    }
}

/// Represents a backend metastore for the federation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BackendMetastore {
    /// The relative resource name of the metastore that is being federated.
    /// The formats of the relative resource names for the currently supported
    /// metastores are listed below:
    ///
    /// * BigQuery
    ///   * `projects/{project_id}`
    /// * Dataproc Metastore
    ///   * `projects/{project_id}/locations/{location}/services/{service_id}`
    pub name: std::string::String,

    /// The type of the backend metastore.
    pub metastore_type: crate::model::backend_metastore::MetastoreType,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl BackendMetastore {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::BackendMetastore::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [metastore_type][crate::model::BackendMetastore::metastore_type].
    pub fn set_metastore_type<
        T: std::convert::Into<crate::model::backend_metastore::MetastoreType>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.metastore_type = v.into();
        self
    }
}

impl wkt::message::Message for BackendMetastore {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.BackendMetastore"
    }
}

/// Defines additional types related to [BackendMetastore].
pub mod backend_metastore {
    #[allow(unused_imports)]
    use super::*;

    /// The type of the backend metastore.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum MetastoreType {
        /// The metastore type is not set.
        Unspecified,
        /// The backend metastore is BigQuery.
        Bigquery,
        /// The backend metastore is Dataproc Metastore.
        DataprocMetastore,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [MetastoreType::value] or
        /// [MetastoreType::name].
        UnknownValue(metastore_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod metastore_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl MetastoreType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Bigquery => std::option::Option::Some(2),
                Self::DataprocMetastore => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("METASTORE_TYPE_UNSPECIFIED"),
                Self::Bigquery => std::option::Option::Some("BIGQUERY"),
                Self::DataprocMetastore => std::option::Option::Some("DATAPROC_METASTORE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for MetastoreType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for MetastoreType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for MetastoreType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                2 => Self::Bigquery,
                3 => Self::DataprocMetastore,
                _ => Self::UnknownValue(metastore_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for MetastoreType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "METASTORE_TYPE_UNSPECIFIED" => Self::Unspecified,
                "BIGQUERY" => Self::Bigquery,
                "DATAPROC_METASTORE" => Self::DataprocMetastore,
                _ => Self::UnknownValue(metastore_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for MetastoreType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Bigquery => serializer.serialize_i32(2),
                Self::DataprocMetastore => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for MetastoreType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MetastoreType>::new(
                ".google.cloud.metastore.v1.BackendMetastore.MetastoreType",
            ))
        }
    }
}

/// Request message for ListFederations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFederationsRequest {
    /// Required. The relative resource name of the location of metastore
    /// federations to list, in the following form:
    /// `projects/{project_number}/locations/{location_id}`.
    pub parent: std::string::String,

    /// Optional. The maximum number of federations to return. The response may
    /// contain less than the maximum number. If unspecified, no more than 500
    /// services are returned. The maximum value is 1000; values above 1000 are
    /// changed to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous ListFederationServices
    /// call. Provide this token to retrieve the subsequent page.
    ///
    /// To retrieve the first page, supply an empty page token.
    ///
    /// When paginating, other parameters provided to
    /// ListFederationServices must match the call that provided the
    /// page token.
    pub page_token: std::string::String,

    /// Optional. The filter to apply to list results.
    pub filter: std::string::String,

    /// Optional. Specify the ordering of results as described in [Sorting
    /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
    /// If not specified, the results will be sorted in the default order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListFederationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListFederationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListFederationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListFederationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListFederationsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListFederationsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListFederationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ListFederationsRequest"
    }
}

/// Response message for ListFederations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFederationsResponse {
    /// The services in the specified location.
    pub federations: std::vec::Vec<crate::model::Federation>,

    /// A token that can be sent as `page_token` to retrieve the next page. If this
    /// field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListFederationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [federations][crate::model::ListFederationsResponse::federations].
    pub fn set_federations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Federation>,
    {
        use std::iter::Iterator;
        self.federations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListFederationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListFederationsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListFederationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.ListFederationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListFederationsResponse {
    type PageItem = crate::model::Federation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.federations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for GetFederation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetFederationRequest {
    /// Required. The relative resource name of the metastore federation to
    /// retrieve, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetFederationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetFederationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetFederationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.GetFederationRequest"
    }
}

/// Request message for CreateFederation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFederationRequest {
    /// Required. The relative resource name of the location in which to create a
    /// federation service, in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}`.
    pub parent: std::string::String,

    /// Required. The ID of the metastore federation, which is used as the final
    /// component of the metastore federation's name.
    ///
    /// This value must be between 2 and 63 characters long inclusive, begin with a
    /// letter, end with a letter or number, and consist of alpha-numeric
    /// ASCII characters or hyphens.
    pub federation_id: std::string::String,

    /// Required. The Metastore Federation to create. The `name` field is
    /// ignored. The ID of the created metastore federation must be
    /// provided in the request's `federation_id` field.
    pub federation: std::option::Option<crate::model::Federation>,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateFederationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateFederationRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [federation_id][crate::model::CreateFederationRequest::federation_id].
    pub fn set_federation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.federation_id = v.into();
        self
    }

    /// Sets the value of [federation][crate::model::CreateFederationRequest::federation].
    pub fn set_federation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Federation>,
    {
        self.federation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [federation][crate::model::CreateFederationRequest::federation].
    pub fn set_or_clear_federation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Federation>,
    {
        self.federation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateFederationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateFederationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.CreateFederationRequest"
    }
}

/// Request message for UpdateFederation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateFederationRequest {
    /// Required. A field mask used to specify the fields to be overwritten in the
    /// metastore federation resource by the update.
    /// Fields specified in the `update_mask` are relative to the resource (not
    /// to the full request). A field is overwritten if it is in the mask.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The metastore federation to update. The server only merges fields
    /// in the service if they are specified in `update_mask`.
    ///
    /// The metastore federation's `name` field is used to identify the
    /// metastore service to be updated.
    pub federation: std::option::Option<crate::model::Federation>,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateFederationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateFederationRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateFederationRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [federation][crate::model::UpdateFederationRequest::federation].
    pub fn set_federation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Federation>,
    {
        self.federation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [federation][crate::model::UpdateFederationRequest::federation].
    pub fn set_or_clear_federation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Federation>,
    {
        self.federation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateFederationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateFederationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.UpdateFederationRequest"
    }
}

/// Request message for DeleteFederation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteFederationRequest {
    /// Required. The relative resource name of the metastore federation to delete,
    /// in the following form:
    ///
    /// `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
    pub name: std::string::String,

    /// Optional. A request ID. Specify a unique request ID to allow the server to
    /// ignore the request if it has completed. The server will ignore subsequent
    /// requests that provide a duplicate request ID for at least 60 minutes after
    /// the first request.
    ///
    /// For example, if an initial request times out, followed by another request
    /// with the same request ID, the server ignores the second request to prevent
    /// the creation of duplicate commitments.
    ///
    /// The request ID must be a valid
    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
    /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteFederationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteFederationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteFederationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteFederationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.metastore.v1.DeleteFederationRequest"
    }
}
